<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:p="http://primefaces.org/ui" template="/bootstraplayout.xhtml">


	<ui:define name="title">
		<h:outputText value="Applications" />

	</ui:define>



	<ui:define name="toptoolbar">

		<ui:include src="authenticatedtoolbar.xhtml" />


	</ui:define>

	<ui:define name="navigation">
		<p:menu>
			<p:submenu label="Actions">
				<p:menuitem value="View Applications" outcome="applications.jsf"
					icon="ui-icon-star" />
					
				<p:menuitem value="Add Application" outcome="newapplication.jsf"
					icon="ui-icon-star" />
					
			
			</p:submenu>
			
		</p:menu>
	</ui:define>

	<ui:define name="mainform">

		<p:dataTable var="a" value="#{applicationsForm.model}" lazy="true"
			rowKey="#{application.id}" 
			style="overflow: auto" paginator="true" rows="10" id="applications">
			<f:facet name="header">
				<h:outputText value="Applications" />
			</f:facet>

			

			<p:column headerText="#{msg.name}">
				<h:commandLink action="#{applicationsForm.goTo(a)}" style="margin-right:20px;" immediate="true">  
       				<h:outputText value="#{a.name}" />
    			</h:commandLink>  
				
			</p:column>

			
			<p:column headerText="#{msg.created}">
				
				<h:commandLink action="#{applicationsForm.goTo(a)}" style="margin-right:20px;" immediate="true">  
       				<h:outputText value="#{a.createdDate}" converter="#{prettyTimeConverter}" />
    			</h:commandLink> 
				
			</p:column>


			
			<f:facet name="footer">
				<p:commandButton value="Export Excel" ajax="false">
					<p:dataExporter type="xls" target="applications" fileName="applications" />
				</p:commandButton>

				<p:commandButton value="Export PDF" ajax="false">
					<p:dataExporter type="pdf" target="applications" fileName="applications" />
				</p:commandButton>

				<p:commandButton value="Export CSV" ajax="false">
					<p:dataExporter type="csv" target="applications" fileName="applications" />
				</p:commandButton>

				<p:commandButton value="Export XML" ajax="false">
					<p:dataExporter type="xml" target="applications" fileName="applications" />
				</p:commandButton>
			</f:facet>
			

		</p:dataTable>



	</ui:define>



</ui:composition>